home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 09-05.C < prev    next >
Text File  |  1992-01-31  |  672b  |  38 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char triangle[] = {
  8.    0x11,0x11,0x11,0x11,0x10,
  9.    0x01,0x22,0x22,0x21,0x00,
  10.    0x00,0x12,0x22,0x10,0x00,
  11.    0x00,0x01,0x21,0x00,0x00,
  12.    0x00,0x00,0x10,0x00,0x00
  13.    };
  14.  
  15. void main()
  16. {
  17.    int old_mode;
  18.  
  19.    if (fg_testmode(13,1) == 0) {
  20.       printf("This program requires a 320 ");
  21.       printf("x 200 EGA graphics mode.\n");
  22.       exit(1);
  23.       }
  24.  
  25.    old_mode = fg_getmode();
  26.    fg_setmode(13);
  27.  
  28.    fg_setcolor(7);
  29.    fg_rect(0,319,0,199);
  30.  
  31.    fg_move(156,101);
  32.    fg_drwimage(triangle,5,5);
  33.    fg_waitkey();
  34.  
  35.    fg_setmode(old_mode);
  36.    fg_reset();
  37. }
  38.